import { ValidationError, ValidationPipe } from '@nestjs/common'

export class CustomValidPip extends ValidationPipe {
   protected flattenValidationErrors(validationErrors: ValidationError[]): any {
      let mess = ''
      validationErrors.map((item) => {
         mess = Object.values(item.constraints)[0] + ',' + mess
      })

      return mess.slice(-1) == ',' ? mess.slice(0, -1) : mess
   }
}
